package de.bazinga.rotw.network;

import com.captiveimagination.jgn.clientserver.JGNConnection;
import com.captiveimagination.jgn.clientserver.JGNConnectionListener;

import de.bazinga.rotw.game.RotwGameState;
import de.bazinga.rotw.network.message.MapMessage;

public class RotwConnectionListener implements JGNConnectionListener {

	private RotwGameState gameState = null;
	
	public RotwConnectionListener(RotwGameState gameState) {
		this.gameState = gameState;
	}
	
	@Override
	public void connected(JGNConnection conn) {
		// Send Client Basic Information
		MapMessage mapMsg = new MapMessage();
		mapMsg.setMapName(gameState.getCurrentMapName());
		
		conn.sendMessage(mapMsg);
	}

	@Override
	public void disconnected(JGNConnection arg0) {
		// TODO Auto-generated method stub
		
	}

}
